package com.ywu.application.standard.dataSource.entity;

import com.ywu.application.standard.dataSource.dto.*;
import com.ywu.common.entity.CommonEntity;
import lombok.Data;

import java.util.List;

/**
 * @ClassName YwuDataExecEntity
 * @Description TODO
 * @Author GroundDemo
 * @Date 2024/10/31 17:45
 * @Version 1.0
 **/
@Data
public class YwuDataExecEntity extends CommonEntity {
    public static final String INSERT_EXEC_TYPE = "INSERT";

    public static final String UPDATE_EXEC_TYPE = "UPDATE";

    public static final String DELETE_EXEC_TYPE = "DELETE";

    public static final String QUERY_EXEC_TYPE = "QUERY";

    // 复杂查询
    public static final String COMPLEX_QUERY_EXEC_TYPE = "COMPLEX_QUERY";

    public static final String ONLINE_STATUS = "ONLINE";

    public static final String DRAFT_STATUS = "DRAFT";

    private String id;

    private String code;

    private String name;

    private String execType;

    private List<String> execFields;

    private String execFieldsStr;

    private List<YwuDataConditionDto> execCondition;

    private String execConditionStr;

    private String execSql;

    private String conditionFields;

    private String dataSourceCode;

    private String dataSourceId;

    private String dataSourceName;

    private String dataTableId;

    private String dataTableCode;

    private String dataTableName;

    private String status;

    private Integer currentVersion;

    private Boolean hasNotReleased;

    private String dataSourceType;

    private String dataSourceTenantId;

    private List<YwuExecCommonParamDto> fieldParam;

    private List<YwuExecCommonParamDto> conditionParam;

    private List<YwuExecCommonParamDto> groupConditionParam;

    private YwuDataExecComplexQueryPageDto pageFields;


    private String execFieldsView ;

    private String execConditionView;

    // 复杂查询是多表查询，包括表的连接字段、条件字段、分组字段、排序字段等；操作字段也需要适配聚合函数
    // 复杂查询 - 多表
    private List<String> dataTableCodeList;
    // 复杂查询的操作字段不再是普通的字符串
    private List<YwuDataExecComplexQueryFieldDto> complexQueryFieldList;
    // 多表连接查询关联的对象
    private List<YwuDataExecComplexQueryTableJoinDto> complexQueryTableJoinList;
    // 分组字段
    private List<String> groupFields;
    // 分组过滤条件
    private List<YwuDataExecComplexQueryGroupConditionDto> groupCondition;
    // 排序字段
    private List<YwuDataExecComplexQueryOrderDto> sortFields;

    private String complexQueryFieldListStr;

    private String complexQueryTableJoinListStr;

    private String groupFieldsStr;

    private String groupConditionStr;

    private String sortFieldsStr;

    private Boolean enablePageInfo;

    private String groupConditionFields;
}
